package org.elsfs.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.Instant;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * oauth2客户端实体
 *
 * @author zeng
 * @since 0.0.1
 */
@Data
@TableName("sys_registered_client")
@Accessors(chain = true)
public class SysRegisteredClient implements Serializable {

  @TableId(type = IdType.ASSIGN_ID)
  private String id;

  private String clientId;
  private Instant clientIdIssuedAt;
  private String clientSecret;
  private Instant clientSecretExpiresAt;
  private String clientName;

  /**
   * client_secret_basic client_secret_post client_secret_jwt private_key_jwt none 转换
   * org.springframework.security.oauth2.core.ClientAuthenticationMethod
   */
  private String clientAuthenticationMethods;

  /**
   * authorization_code refresh_token client_credentials urn:ietf:params:oauth:grant-type:jwt-bearer
   * urn:ietf:params:oauth:grant-type:device_code
   * org.springframework.security.oauth2.core。AuthorizationGrantType
   */
  private String authorizationGrantTypes;

  /** redirectUris */
  private String redirectUris;

  /** 注销后重定向 url */
  private String postLogoutRedirectUris;

  /** scopes */
  private String scopes;

  /**
   * client.require-proof-key client.require-authorization-consent client.jwk-set-url
   * client.token-endpoint-authentication-signing-algorithm
   * org.springframework.security.oauth2.server.authorization.settings。ClientSettings
   */
  private String clientSettings;

  /**
   * token. token.authorization-code-time-to-live token.access-token-time-to-live
   * token.access-token-format token.device-code-time-to-live token.reuse-refresh-tokens
   * token.refresh-token-time-to-live token.id-token-signature-algorithm
   */
  private String tokenSettings;
}
